var xmlHttp; 

function createXMLRequest(){
	if(window.ActiveXObject){
		xmlHttp=new ActiveXObject("Microsoft.XMLHttp");
	} else if(window.XMLHttpRequest){
		xmlHttp=new XMLHttpRequest();
	}
}
//修改课程名
function changename(id){   
	createXMLRequest();     
	var name=document.getElementById('name').value;  
	var url="/courses/course/lession/?name="+name+"&courseid="+id;
	xmlHttp.open("GET",url);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4 && xmlHttp.status==200){
			if(xmlHttp.responseText==1){
				document.getElementById('coursename').innerHTML=name;
				$("#change_title").popover('hide');
			}
		}
	};
	xmlHttp.send(); 
}
//修改课程介绍
function changeintro(id){   
	createXMLRequest();     
	var intro=document.getElementById('intro').value;  
	var url="/courses/course/lession/?intro="+intro+"&courseid="+id;
	xmlHttp.open("GET",url);
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4 && xmlHttp.status==200){
			if(xmlHttp.responseText==1){
				document.getElementById('courseintro').innerHTML=intro;
				$("#change_intro").popover('hide');
			}
		}
	};
	xmlHttp.send(); 
}